/*
* Accord Software, Inc.
*
* Tutorial 16
*
* typedefs
*/
#include "matrix.h"
/* build up matrices a and b */
static struct matrix a = {
1, 2, 3,
4, 5, 6,
7, 8, 9
};
static struct matrix b = {
10, 11, 12,
13, 14, 15,
16, 17, 18
};
main(argc, argv)
int argc;
char *argv[];
{
MatrixName data;
MATRIX sum;
Mp sp = ∑
char *progname = argv[0];
int y;
int x;
/*
* send the matrices to be added
*/
sum = addmatrix(&a, &b);
printf("%s matrix sum\n", progname);
for (y = 0; y < Y; y++) {
printf("{ ");
for (x = 0; x < X; x++) {
printf("%d ", elem(sp));
}
printf("}\n");
}
data.name = "hello";
data.data = sum;
matrixname(&data);
exit(0);
}